home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-05-01 | 4.7 KB | 110 lines | [TEXT/MPS ] |
- ; Copyright © 1987-1990 by Apple Computer, Inc. All rights reserved.
- ; UDebug assembly language routines
-
- Blanks On
- String AsIs
- Case On
-
- Print Off
- Include 'Macros.a'
-
- LOAD 'ProgStrucMacs.d'
- LOAD 'FlowCtlMacs.d'
- Print On
-
- IF qDebug then
- Import DEBUGEXCEPTION ; in UDebug
-
- XDEBUGSYSERROR Proc Export ; SysError(errorCode: integer) [arg is in Reg D0]
- Clr.L -(SP) ; leave room for DEBUGException to leave our continuation address
- MoveM.L A0-A7/D0-D7,-(SP) ; save registers
- Move.W D0,-(SP) ; push errorCode On stack to call Pascal
- Jsr DEBUGEXCEPTION ; call a Pascal routine
- MoveM.L (SP)+,A0-A7/D0-D7 ; restore registers
- Rts ; leave things just as they were when we started, And go to debugger
- EndProc
-
- Seg 'MADebugger' ; MUST BE IN Main SEGMENT
- XDEBUGBUSERROR Proc Export ; Bus error
- Clr.L -(SP) ; leave room for DEBUGEXCEPTION to leave our continuation address
- MoveM.L A0-A7/D0-D7,-(SP) ; save registers
- Move.W #902,-(SP) ; push errorCode On stack to call Pascal
- Jsr DEBUGEXCEPTION ; call a Pascal routine
- MoveM.L (SP)+,A0-A7/D0-D7 ; restore registers
- Rts ; leave things just as they were when we started, And go to debugger
- EndProc
-
- Seg 'MADebugger' ; MUST BE IN Main SEGMENT
- XDEBUGADDRERROR Proc Export ; Address error
- Clr.L -(SP) ; leave room for DEBUGEXCEPTION to leave our continuation address
- MoveM.L A0-A7/D0-D7,-(SP) ; save registers
- Move.W #903,-(SP) ; push errorCode On stack to call Pascal
- Jsr DEBUGEXCEPTION ; call a Pascal routine
- MoveM.L (SP)+,A0-A7/D0-D7 ; restore registers
- Rts ; leave things just as they were when we started, And go to debugger
- EndProc
-
- Seg 'MADebugger' ; MUST BE IN Main SEGMENT
- XDEBUGILLINST Proc Export ; Illegal Instruction
- Clr.L -(SP) ; leave room for DEBUGEXCEPTION to leave our continuation address
- MoveM.L A0-A7/D0-D7,-(SP) ; save registers
- Move.W #904,-(SP) ; push errorCode On stack to call Pascal
- Jsr DEBUGEXCEPTION ; call a Pascal routine
- MoveM.L (SP)+,A0-A7/D0-D7 ; restore registers
- Rts ; leave things just as they were when we started, And go to debugger
- EndProc
-
- Seg 'MADebugger' ; MUST BE IN Main SEGMENT
- XDEBUGZERODIV Proc Export ; Zero Divide
- Clr.L -(SP) ; leave room for DEBUGEXCEPTION to leave our continuation address
- MoveM.L A0-A7/D0-D7,-(SP) ; save registers
- Move.W #905,-(SP) ; push errorCode On stack to call Pascal
- Jsr DEBUGEXCEPTION ; call a Pascal routine
- MoveM.L (SP)+,A0-A7/D0-D7 ; restore registers
- Rts ; leave things just as they were when we started, And go to debugger
- EndProc
-
- Seg 'MADebugger' ; MUST BE IN Main SEGMENT
- XDEBUGCHECK Proc Export ; Chk
- Clr.L -(SP) ; leave room for DEBUGEXCEPTION to leave our continuation address
- MoveM.L A0-A7/D0-D7,-(SP) ; save registers
- Move.W #906,-(SP) ; push errorCode On stack to call Pascal
- Jsr DEBUGEXCEPTION ; call a Pascal routine
- MoveM.L (SP)+,A0-A7/D0-D7 ; restore registers
- Rts ; leave things just as they were when we started, And go to debugger
- EndProc
-
- Seg 'MADebugger' ; MUST BE IN Main SEGMENT
- XDEBUGOVERFLOW Proc Export ; TrapV
- Clr.L -(SP) ; leave room for DEBUGEXCEPTION to leave our continuation address
- MoveM.L A0-A7/D0-D7,-(SP) ; save registers
- Move.W #907,-(SP) ; push errorCode On stack to call Pascal
- Jsr DEBUGEXCEPTION ; call a Pascal routine
- MoveM.L (SP)+,A0-A7/D0-D7 ; restore registers
- Rts ; leave things just as they were when we started, And go to debugger
- EndProc
-
- Seg 'MADebugger' ; MUST BE IN Main SEGMENT
- XDEBUGLINEF Proc Export ; Line 1111 traps
- Clr.L -(SP) ; leave room for DEBUGEXCEPTION to leave our continuation address
- MoveM.L A0-A7/D0-D7,-(SP) ; save registers
- Move.W #911,-(SP) ; push errorCode On stack to call Pascal
- Jsr DEBUGEXCEPTION ; call a Pascal routine
- MoveM.L (SP)+,A0-A7/D0-D7 ; restore registers
- Rts ; leave things just as they were when we started, And go to debugger
- EndProc
-
- ; Seg 'MADebugger' ; MUST BE IN Main SEGMENT
- ; .Proc XDEBUGNMI ; NMI (level 7)
- ; Clr.L -(SP) ; leave room for DEBUGEXCEPTION to leave our continuation address
- ; MoveM.L A0-A7/D0-D7,-(SP) ; save registers
- ; Move.W #900,-(SP) ; push errorCode On stack to call Pascal
- ; Jsr DEBUGEXCEPTION ; call a Pascal routine
- ; MoveM.L (SP)+,A0-A7/D0-D7 ; restore registers
- ; Rts ; leave things just as they were when we started, And go to debugger
- ; EndProc
-
- Endif
-
- End
-